<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<sj:head jqueryui="true"/>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Role Management</title>
<link href="./css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<sj:div id="YardRoleDiv" cssClass="subnavcontent">
<s:form id="yardRoleForm" theme="simple">

	
	<table>
		<tr>
			<td>Select Yard : <s:select label="Select Role" headerKey="-1"
				headerValue="Select Yard" list="listRole" listKey="id"
				listValue="name" name="selectedRoleId" /></td>
		</tr>
		<tr>
			<s:url var="url" action="roleDetailsAction"/>
			<td align="right">
			<sj:submit value="Create Role"
				name="Create Role" href="%{url}" cssClass="btnbg"  targets="YardRoleDiv"/></td>
		</tr>
	</table>
	<table width="100%" border="0" align="center" cellpadding="4"
		cellspacing="1" class="gridtable">
		<tr>
			<td>Role Name</td>
			<td>Company Name</td>

		</tr>

		<s:if test="%{listRole.size()} > 0">
			<tr>

				<td>No Roles available.</td>
			</tr>
		</s:if>
		<s:else>
			<s:iterator value="listRole" var="role">
				<tr>

					<td>
						<s:url var="url" action="roleDetailsAction">
						<s:param name="selectedRoleId" value="#role.id" />
						</s:url> 
						<sj:a href="%{url}" targets="YardRoleDiv">
							<s:property value="name"/>
						</sj:a>
					</td>
					<td><s:property value="owningCompany.name" /></td>
				</tr>
			</s:iterator>
		</s:else>



	</table>
	
</s:form>
</sj:div>
</body>
</html>